'use strict'

//定义数组
let arr = [
  'a', 'b', 'c'
]

console.log(
  arr.map(x => {return x+x})
)

//定义一个对象
let obj = {
  'content-type': 'application/json',
  key: 505,
  images: []
}

obj.name = 'xyz'
obj['x-y'] = '<x-y></x-y>'

arr.forEach(x => {
  obj[x] = x
})

for (let k in obj) {
  console.log(k, ' ==> ', obj[k])
}

//------- 数组的长度和其他属性 -------
console.log(
  arr.length,
  typeof arr,
  Array.isArray(arr)
)

arr.__state__ = 'ok'
console.log(arr.__state__)
